import math


def zeroone(N, i):
    currArr = [math.floor(N / 2), N % 2, math.floor(N / 2)]
    if i == -1:
        res.extend(currArr)
    else:
        for j in range(len(currArr)):
            res.insert(i + j, currArr[j])
        del (res[i + len(currArr)])

    for k in range(len(res)):
        if res[k] > 1:
            zeroone(res[k], k)


x = input()

N = round(int(x[0]))
L = round(int(x[2]))
R = round(int(x[4]))


res = []
count = 0

zeroone(N, -1)
for i in range(L, R + 1):
    if res[i] == 1:
        count += 1

print(count)
